python program to count number of words in string